package main

import (
	"github.com/Unixeno/TheMoon/logging"
	"github.com/Unixeno/TheMoon/planet/config"
	"github.com/Unixeno/TheMoon/planet/core"
)

var logger = logging.GetLogger("core")

func main() {
	// 获取config
	err := config.Init()
	if err != nil {
		logger.WithError(err).Fatal("failed to parse configure")
	}
	logging.SetGlobalLevel(logging.GetLevel(config.SysConfig.LogLevel))

	logger.WithField("PlanetID", config.SysConfig.ServerID).Info()

	// 启动核心
	core.Init()

	core.Run()
}